package pers.yurwisher.rubick.gateway.exception;

import pers.yurwisher.rubick.common.enums.ICustomTipEnum;
import pers.yurwisher.rubick.common.wrapper.CustomTip;

/**
 * @author yq
 * @date 2021年4月13日 15:20:15
 * @description 服务器异常
 * @since V1.0.0
 */
public enum GatewayCustomTipEnum implements ICustomTipEnum {
    /**服务器异常*/
    SERVICE_404(404,"未发现有效服务"),
    SERVICE_500(500,"服务异常"),
    SERVICE_504(504,"服务超时"),
    SERVICE_500_2(500,"服务连接超时"),
    ;

    /**
     * 错误编码
     */
    private CustomTip tip;

    GatewayCustomTipEnum(String msg) {
        this.tip = CustomTip.error(msg);
    }

    GatewayCustomTipEnum(Integer code, String msg) {
        this.tip = CustomTip.of(code,msg);
    }

    @Override
    public CustomTip tip() {
        return tip;
    }
}
